// basic/components/child.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title: {
      type: Object,
      value: 'hello'
    }
  },

  relations: {
    './parent': {
      type: 'parent',
      linked(target) {
        console.log(target)
      }
    }
  },

  attached() {
    console.log(this.data.title)
  },

  observers: {
    title() {
      
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    childtitle: 'childtitle'
  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleTap() {
      this.setData({
        title: {
          x: 200
        }
      })

      this.triggerEvent('myevent', 'def')
    }
  },

  observers: {
    childtitle(newValue) {
      console.log(newValue)
    }
  }
})
